<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'loadXml.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

   <script type="text/javascript" language="javascript">
     // 加载xml文档
     var xmlFile;
	function  loadXML(xmlFile)
	{
	    var xmlDoc;
	    if(window.ActiveXObject)
	    {
	        xmlDoc    = new ActiveXObject('Microsoft.XMLDOM');
	        xmlDoc.async    = false;
	        xmlDoc.load(xmlFile);
	        //alert('ms:'+xmlFile);
	        //alert(xmlDoc);
	    }
	    else if (document.implementation && document.implementation.createDocument)
	    {
	        xmlDoc    = document.implementation.createDocument('', '', null);
	        xmlDoc.load(xmlFile);
	        alert('ff:'+xmlFile);
	    }
	    else
	    {
	        return null;
	    }
	    
	    return xmlDoc;
	}
	
	// 首先对xml对象进行判断
	checkXMLDocObj    = function(xmlFile)
	{
	    var xmlDoc    = loadXML(xmlFile);
	    alert(xmlDoc);
	    if(xmlDoc==null)
	    {
	        alert('您的浏览器不支持xml文件读取,于是本页面禁止您的操作,推荐使用IE5.0以上可以解决此问题!');
	        window.location.href='/index.jsp';
	    }
	    
	    return xmlDoc;
	}
	
	// 然后开始获取需要的Login/Weapon/W的第一个节点的属性值
	//var xmlDoc    = checkXMLDocObj('/fileUpload/flashPic/js/homeSite_pic.xml');
	//var v    = xmlDoc.getElementsByTagName('bcaster/item')[0].childNodes.getAttribute('titleName')
	var focus_width=478;
	var focus_height=205;
	var text_height=20;
	var swf_height = focus_height+text_height;

	var pics = '';
	var links = '';
	var texts = '';
	
	display  = function(xPath)
	{
	    var xmlDoc    = loadXML('/fileUpload/flashPic/js/homeSite_pic.xml');
	    //alert(xmlDoc.getElementsByTagName('bcaster/item')[3].getAttribute('titleName'));
	    var li=xmlDoc.getElementsByTagName('bcaster/item');
	    for(var dd=0;dd<li.length;dd++)
	    {
	       alert(li[dd].getAttribute('id'));
	       if(dd==0)
	       {
	        pics ='';
	        links = '';
	        texts = '';
	         pics = escape(li[dd].getAttribute('item_url'));
	         links = escape(li[dd].getAttribute('link'));
	         texts =  escape(li[dd].getAttribute('titleName'));
	         
	         
	       }
	       else
	       {
	         pics =pics +"|"+ escape(li[dd].getAttribute('item_url'));
	         links = links +"|"+ escape(li[dd].getAttribute('link'));
	         texts = texts +"|"+ escape(li[dd].getAttribute('titleName'));
	       }
	    }
	    
	    //alert('pics:'+pics+'\n'+'links:'+links+'\n'+texts+'\n');
	   //document.write('pics:'+pics);
       //document.write('links:'+links);
       //document.write('texts:'+texts);
	  document.write('<embed src="/fileUpload/flashPic/js/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F4FAFB" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"/>');
	}
	
     
   </script>
  </head>
  
  <body>
   
     <!--幻灯片新闻开始-->
<DIV id=slideimg>
sssssssssssss
<FONT color=#ffffff>
<script language="javascript" type="text/javascript">display('/fileUpload/flashPic/js/homeSite_pic.xml');</script>
</FONT>
 dsklsklkldskl
</DIV><!--幻灯片新闻结束-->
  </body>
</html>
